﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>
<%@ Import Namespace="MyAlbum.Model" %>
<%@ Import Namespace="PersonalAlbum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.Tooltip(MyAlbum.Services.Configuration.ConfigValues.SectionsPerRow)%>


<%--<embed src="Content/Images/PB131107.mov" width="402" height="315" border="1" controller=true>
  </embed>
  
  <embed src="Content/Images/PB131107.mov" Pluginspage="http://www.apple.com/quicktime/" width="317" height="258" CONTROLLER=true LOOP=false AUTOPLAY=true name="slideshow"></embed> 
--%>
 

<%--<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
	<param name="src" value="http://localhost:52161/Content/Images/PB131107.MOV"/>
	<param name="autoplay" value="false"/>
	<param name="controller" value="true"/>
	<param name="loop" value="false"/>
	<embed src="http://localhost:52161/Content/Images/PB131107.MOV"  autoplay="false" controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/" />
</object>
-----------------<br />
<OBJECT id='mediaPlayer' width="320" height="285" 
      classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
      standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
      <param name='fileName' value="http://servername/path/to/media.file">
      <param name='animationatStart' value='true'>
      <param name='transparentatStart' value='true'>
      <param name='autoStart' value="false">
      <param name='showControls' value="true">
      <param name='loop' value="false">
      <EMBED type='application/x-mplayer2'
        pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
        id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
        bgcolor='darkblue' showcontrols="true" showtracker='-1' 
        showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
        src="http://servername/path/to/media.file" autostart="false" designtimesp='5311' loop="false">
      </EMBED>
      </OBJECT>
-------------<br />
<video src="http://www.ananova.com/about/vap_windows_check.wmv">
your browser does not support the video tag
</video>

----------------<br />
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/zftaG6GjJ-g&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/zftaG6GjJ-g&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>--%>
    <span class="errorMessage"><%=Html.Encode( Model.ErrorMessage)%></span>
        <%
            int itemPerRow = Math.Max(1, Model.Configuration.SectionsPerRow);
            string width = ((90-itemPerRow*4) / itemPerRow).ToString()+"%";
            foreach (var item in Model.Sections)
            {
                Model.CurrentSection = item;
                %>
             <div style=" width:<%=width%>" class="sectionBox">
            <%Html.RenderPartial("SectionItem", Model);%>
                <%if (Model.User.AllowActions())
                      {%>
                      <%using (Html.BeginForm<CategoriesController>(a => a.Delete(item.Id), FormMethod.Post, new { id = "formDelete" + item.Id }))
                         { %>
                        <%=Html.Hidden("returnUrl", Request.RawUrl)%>
                         <%=Html.AntiForgeryToken()%>
                       <%} %>
                           <a href="javascript:void(0)" onclick="deleteSection('<%=item.Id %>')">   
                                 <img class="actionImage" src="<%=Html.ThemeItem("Delete.gif")%>" alt="<%=Model.Localize("Section.Delete") %>" title="<%=Model.Localize("Section.Delete") %>" />
                          </a>
                      &nbsp;
                         <a href="javascript:void(0)" onclick="showEditSection('<%=item.Id %>');return false">
                            <img class="actionImage" title="<%=Model.Localize("Section.Edit") %>" src="<%=Html.ThemeItem("Edit.gif")%>" alt="<%=Model.Localize("Section.Edit") %>" />
                        </a>
                <% }%>
              </div>
              <%} %>
    <%if (Model.User.AllowActions())
      {%>
            <a href="javascript:void(0)" onclick="showAddSection();return false">
                <%=Model.Localize("Section.AddSection")%>
             </a>
              &nbsp;
            <%=Html.ActionLink(Model.Localize("Section.AllAlbums"), "Index", "Albums")%>
      <%}%>
     
<script type="text/javascript">
        function deleteSection(id) {
            if (confirm('<%=Model.Localize("Section.ConfirmDelete")%>')) {
                document.getElementById('formDelete' + id).submit();
            }
            return false;
        }
</script>
 <% if (Model.User.AllowActions())
           {%>
  <script type="text/javascript">
           <!--
      function showAddSection() {
          $.ajax({
          url: '<%=Url.Action("ShowCreate","Categories") %>',
              metehod: 'post',
              dataType: 'html',
              success: function(t) {
                  document.getElementById('editSectionDivContent').innerHTML = t;
                  $('#AddSectionForm').validate();
                  document.getElementById('editSectionDivTopContent').innerHTML = '<%=Model.Localize("Section.AddSection") %>';
                  $('#editSectionDiv').show();
                  document.getElementById('returnUrl').value = '<%=Html.Encode(Request.RawUrl) %>';
              }, error: function(err) {
                  alert('<%=Model.Localize("Entry.Error") %>');
              }
          });
      }
      function showEditSection(id) {
          $.ajax({
          url: '<%=Url.Action("ShowUpdate","Categories",new{id="sectionId"}) %>'.replace('sectionId', id.toString()),
              metehod: 'post',
              dataType: 'html',
              success: function(t) {
                  document.getElementById('editSectionDivContent').innerHTML = t;
                  $('#UpdateSectionForm').validate();
                  document.getElementById('editSectionDivTopContent').innerHTML = '<%=Model.Localize("Section.Edit")%>';
                  $('#editSectionDiv').show();
                  document.getElementById('returnUrl').value = '<%=Html.Encode(Request.RawUrl) %>';

              }, error: function(err) {
                  alert('<%=Model.Localize("Entry.Error") %>');
              }
          });
      }
        -->
    </script>
       
    <div class="window" id="editSectionDiv">
	<div class="windowTop" id="editSectionDivTop" style="background-image:url(<%=Html.ThemeItem("window_top_end.png")%>);">
		<div class="windowTopContent" id="editSectionDivTopContent" style="background-image:url(<%=Html.ThemeItem("window_top_start.png")%>);">
		</div><img class="windowClose" src="<%=Html.ThemeItem("window_close.jpg")%>" id="editSectionDivClose" onclick="$('#editSectionDiv').hide()" alt="missing label :Close" />
	</div><div class="windowBottom" id="editSectionDivBottom" style="background-image:url(<%=Html.ThemeItem("window_bottom_end.png")%>);">
		<div class="windowBottomContent" id="editSectionDivBottomContent" style="background-image:url(<%=Html.ThemeItem("window_bottom_start.png")%>);">
			&nbsp;
		</div>
	</div><div class="windowContent" id="editSectionDivContent">
	</div><img class="windowResize" src="<%=Html.ThemeItem("window_resize.gif")%>" id="editSectionDivResize" alt="" />
</div> <script type="text/javascript">
<!--
           $(document).ready(
	function() {
	    $('#editSectionDiv').Resizable(
			{
			    minWidth: 200,
			    minHeight: 200,
			    maxWidth: 600,
			    maxHeight: 800,
			    dragHandle: '#editSectionDivTop',
			    handlers: {
			        se: '#editSectionDivResize'
			    },
			    onResize: function(size, position) {
			        $('#editSectionDivBottom, #editSectionDivBottomContent').css('height', size.height - 33 + 'px');
			        var windowContentEl = $('#editSectionDivContent').css('width', size.width - 25 + 'px');
			        if (!document.getElementById('editSectionDiv').isMinimized) {
			            windowContentEl.css('height', size.height - 48 + 'px');
			        }
			    }
			}
		);
	}
);
-->
</script>
<%} %>
</asp:Content>
